<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('用户列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>昵称：</label>
                                <input type="text" name="nickname"/>
                            </li>
                            <li>
                                <label>用户手机号：</label>
                                <input type="text" name="phone"/>
                            </li>
                            <li>
                                <label>是否正常：</label>
                                <select name="isDisable">
                                    <option value="">所有</option>
                                    <option value="1">正常</option>
                                    <option value="0">封禁</option>
                                </select>
                            </li>
                            <li>
                                <label>等级：</label>
                                <input type="text" name="level"/>
                            </li>
                            <!--<li>
                                <label>父级邀请码：</label>
                                <input type="text" name="pCode"/>
                            </li>-->
                            <li>
                                <label>用户姓名：</label>
                                <input type="text" name="userName"/>
                            </li>
                            <li>
                                <label>身份证号：</label>
                                <input type="text" name="userIdcard"/>
                            </li>
                            <li>
                                <label>QQ号码：</label>
                                <input type="text" name="qqnum"/>
                            </li>
                            <li>
                                <label>用户省份：</label>
                                <input type="text" name="userProvince"/>
                            </li>
                            <li>
                                <label>用户城市：</label>
                                <input type="text" name="userCity"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

           <!-- <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="jjyh:user:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="jjyh:user:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="jjyh:user:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="jjyh:user:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>-->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('jjyh:user:edit')}]];
        var removeFlag = [[${@permission.hasPermi('jjyh:user:remove')}]];
        var prefix = ctx + "jjyh/user";

        $(function() {
            var options = {
                url: prefix + "/listUserHonestyCheck",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "用户",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '用户id',
                    visible: false
                },
                {
                    field: 'nickname',
                    title: '昵称'
                },
                {
                    field: 'headImg',
                    title: '头像',
                    formatter: function(value, row, index) {
                        return $.table.imageView(value);
                    }
                },
                {
                    field: 'phone',
                    title: '用户手机号'
                },
                {
                    field: 'isDisable',
                    title: '是否正常'
                },
                {
                    field: 'levelName',
                    title: '等级'
                },
               /* {
                    field: 'invitationCode',
                    title: '用户的邀请码'
                },
                {
                    field: 'pCode',
                    title: '父级邀请码'
                },
                {
                    field: 'shareUrl',
                    title: '分享连接'
                },
                {
                    field: 'collectionCodeWx',
                    title: '微信收款码'
                },
                {
                    field: 'collectionCodeZfb',
                    title: '支付宝收款码'
                },*/
                {
                    field: 'userName',
                    title: '用户姓名'
                },
                {
                    field: 'userIdcard',
                    title: '身份证号'
                },
                    {
                        field: 'isCheck',
                        title: '身份认证'
                    },
                {
                    field: 'qqnum',
                    title: 'QQ号码'
                },
                {
                    field: 'userBirthday',
                    title: '生日'
                },
                {
                    field: 'userProvince',
                    title: '用户省份'
                },
                {
                    field: 'userCity',
                    title: '用户城市'
                },
               /* {
                    field: 'password',
                    title: '登录密码'
                },*/


                {
                    field: 'disReason',
                    title: '身份认证拒绝原因'
                },
                /*{
                    field: 'wxpayId',
                    title: '微信openid'
                },
                {
                    field: 'wxImage',
                    title: '微信头像'
                },
                {
                    field: 'alipayId',
                    title: '支付宝id'
                },
                {
                    field: 'alipayImage',
                    title: '支付宝头像'
                },*/
                {
                    field: 'idcardImage',
                    title: '身份证正面'
                },
                {
                    field: 'idcardBackimages',
                    title: '身份证反面'
                },
                {
                    field: 'idcardHold',
                    title: '手持身份证'
                },
                    {
                        field: 'isHonestyCheck',
                        title: '诚信认证'
                    },
                    {
                        field: 'honestyDisReason',
                        title: '诚信认证拒绝原因'
                    },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="review(\'' + row.id + '\')"><i class="fa fa-edit"></i>通过</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="reviewDis(\'' + row.id + '\')"><i class="fa fa-edit"></i>拒绝</a> ');
                        /*actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');*/
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });

        function review(id) {
            debugger;
            $.ajax({
                type: "post",
                url: ctx + "jjyh/user/reviewUserHonesty?id="+id,
                success: function(r) {
                    $.modal.msgSuccess("审批成功");
                }
            });
            $("#bootstrap-table").bootstrapTable('refresh', {
                silent: true
            });
        }
        function reviewDis(id) {
            debugger;
            $.modal.open('审批拒绝', prefix + "/reviewHonesty/"+id, '900', '320');
        }

    </script>
</body>
</html>